package net.message;

import static net.Synchronizer.ImageWrapper;
import net.message.processor.IMessageProcessor;
import net.Client;

public class GetImageRequestMessage implements Message{

    public GetImageRequestMessage(byte[] source){
        this(new ImageWrapper(source));
    }

    public final ImageWrapper iw;

    public GetImageRequestMessage(ImageWrapper iw) {
        this.iw = iw;
    }

    @Override
    public void accept(IMessageProcessor processor, Client client) {
        processor.process(this, client);
    }

    @Override
    public byte[] toByteArray() {
        return iw.toByteArray();
    }

    @Override
    public MessageType getType(){
        return MessageType.GET_IMAGE_REQUEST;
    }


}
